#ifndef __BSP_H__
#define __BSP_H__

#include "os_cpu.h"

#define WrUTXH0(ch) (*(volatile unsigned char *)0x50000020)=(unsigned char)(ch)
#define RdURXH0()   (*(volatile unsigned char *)0x50000024)
#define WrUTXH1(ch) (*(volatile unsigned char *)0x50004020)=(unsigned char)(ch)
#define RdURXH1()   (*(volatile unsigned char *)0x50004024)
#define WrUTXH2(ch) (*(volatile unsigned char *)0x50008020)=(unsigned char)(ch)
#define RdURXH2()   (*(volatile unsigned char *)0x50008024)

#define S3C2440_GPBCON  0x56000010
#define S3C2440_GPBDAT  0x56000014
#define S3C2440_GPBUP   0x56000018
#define S3C2440_GPB5_OUTP (0x01 << 10)
#define S3C2440_GPB6_OUTP (0x01 << 12)
#define S3C2440_GPB7_OUTP (0x01 << 14)
#define S3C2440_GPB8_OUTP (0x01 << 16)

#define __raw_readl(a) *(volatile unsigned int *)(a)
#define __raw_writel(v,a) *(volatile unsigned int *)(a) = (v)

int Printf(const char* fmt, ...);
void Install_IRQ_Handler(void * isr);

void BSP_Init(void);
void BSP_InstallTimer4(void);
void BSP_ClearIntPending(void);
INT32U BSP_IsTimer4Pending(void);
void CPU_Init(void);
void LED_On(INT8U n);
void LED_Off(INT8U n);

#endif
